#include"RpcApplication.h"
#include"user.pb.h"
#include"MyRpcChannel.h"
#include"MyRpcController.h"

#include<iostream>
int main(int argc,char ** argv)
{
    RpcApplication::Init(argc,argv);
    fixbug::UserServiceRpc_Stub stub(new MyRpcChannel());
    fixbug::CG_LOGIN_REQUEST request;
    fixbug::GC_LOGIN_RESPONSE response;
    request.set_name("张三");
    request.set_pwd("123");
    MyRpcController myRpcController;
    stub.Register(&myRpcController,&request,&response,nullptr);
    if(myRpcController.Failed())
    {
      std::cout<<myRpcController.ErrorText();
    }else
    {
       if(0 == response.result().errocode())
      {
        std::cout<<"rpc Register success"<<std::endl;
      }else
      {
         std::cout<<"rpc Register erro"<<std::endl;
      }
    }
    
    return 0;
}